package lee.tzz;

import com.sun.org.apache.bcel.internal.classfile.Code;

public class MyList {


    private Node head=null;
    private Integer size;

    public void addLast(Integer data){
        if(head ==null){
            head = new Node(data);
            size++;
            return;
        }
        Node temp = head;
        while (temp.next!=null){
            temp = temp.next;
        }
        temp.next = new Node(data);
        size++;

    }

    class Node{
         Integer data;
         Node next;
         public Node(Integer data){
             this.data = data;
         }

    }

    public Node getHead() {
        return head;
    }

    public void setHead(Node head) {
        this.head = head;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }
}


